package net.lab1024.sa.admin.module.business.supercomputer.selecttablename.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.v3.oas.annotations.Operation;
import net.lab1024.sa.admin.module.business.supercomputer.selecttablename.service.SelectTableService;
import net.lab1024.sa.base.common.domain.ResponseDTO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class SelectTableController {

    @Resource
    private SelectTableService selectTableService;

    @Operation(summary = "读取数据库表名")
    @GetMapping("/select-table-name/show/{sourceId}")
    @SaCheckPermission("select-table-name:show")
    public ResponseDTO<List<String>> show(@PathVariable Integer sourceId) throws Exception {
        return selectTableService.selectAllTableNames(sourceId);
    }



}
